
#ifndef REPLACEDIALOG_H
#define REPLACEDIALOG_H

#include <BButton>
#include <BSlider>
#include <BSpinBox>
#include <BRadioBox>
#include <BDialog>

#include "ColorReplacer.h"
#include "ColorPicker.h"

class ReplaceDialog : public BDialog
{
public:
	ReplaceDialog(BWidget* parent = 0);
	~ReplaceDialog();

protected:
	void slotColorPickButtonToggled(BObject* object, const BValue& value);
	void slotTargetColorPickButtonToggled(BObject* object, const BValue& value);
	void slotColorPickerPicked(BObject* object, const BValue& value);
	void slotColorPickerFinished(BObject* object, const BValue& value);
	void slotColorPickerDetached(BObject* object, const BValue& value);
	void slotColorButtonClicked();
	void slotTargetColorButtonClicked(BObject* object, const BValue& value);
	void slotToleranceSliding(BObject* object, const BValue& value);
	void slotTolenranceEditFinished(BObject* object, const BValue& value);
	void slotTolenranceChanged(BObject* object, const BValue& value);
	void slotRegionButtonGroupChecked(BObject* object, const BValue& value);
	void slotPixelsCatched(BObject* object, const BValue& value);
	void slotApplyButtonClicked();
	void slotResetButtonClicked();
	void slotLoadRecordButtonClicked();
	void slotSaveRecordButtonClicked();

protected:
	virtual void showEvent(const BEvent& event);
	virtual void hideEvent(const BEvent& event);

	virtual void styleEvent(const BEvent& event);
	virtual void paintEvent(const BEvent& event);

private:
	BButton*			_colorPickButton;
	BSpacer*			_colorSpacer;
	BButton*			_colorButton;
	BSlider*			_toleranceSlider;
	BSpinBox*			_toleranceSpinBox;
	BButton*			_targetColorPickButton;
	BSpacer*			_targetColorSpacer;
	BButton*			_targetColorButton;

	BRadioBox*			_constituencyRadioBox;
	BRadioBox*			_wholeLayersRadioBox;

	BButton*			_applyButton;
	BButton*			_resetButton;
	BButton*			_loadRecordButton;
	BButton*			_saveRecordButton;

	BHolder<ColorReplacer>	_colorReplacer;
	BHolder<ColorPicker>	_colorPicker;
};

#endif
